package com.mit.web.vo.design
{
	import com.mit.web.vo.BaseVO;
	import com.mit.web.vo.HistoryComparable;
	
	import mx.collections.ArrayCollection;
	
	[Bindable]
	[RemoteClass(alias="com.mit.common.design.dto.TemplateDTO")]
	public class TemplateVO extends BaseVO implements HistoryComparable
	{
		public var styleId:int;
		public var style:StyleVO;
		public var size:String;
		public var type:String;
		public var worker:int;
		public var workerName:String;
		public var state:String;
		public var partCount:int;
		public var creationDate:Date;
		public var parts:ArrayCollection;
		
		public var original:TemplateVO;

		public function TemplateVO()
		{
			super();
			style = new StyleVO();
			parts = new ArrayCollection();
		}
		public function saveOriginal():void{
			original = new TemplateVO();
			original.worker = worker;
			original.state = state;
		}
		public function isChanged():Boolean{
			return (worker == original.worker
				&& state == original.state);
		}
	}
}